package engine;

import org.junit.Test;

import database.connector.DatabaseFactory;
import database.live.MySqlDAO;

/*
 * 
 * 
 * @Depracated now
 * 
 * This is to setup the system just for Live.. 
 * 
 * TODO : add seed achivements here.
 */

public class LiveWipeAndSeed {
	@Test 
	public void truncateData()
	{
		MySqlDAO d = (MySqlDAO) DatabaseFactory.getDAO();
		if (d.isOpen())
		{
			d.update("TRUNCATE TABLE trackvoodoo.user");
			d.update("TRUNCATE TABLE trackvoodoo.newsitem");
			d.update("TRUNCATE TABLE trackvoodoo.track");
			d.update("TRUNCATE TABLE trackvoodoo.trackpictures");
			d.update("TRUNCATE TABLE trackvoodoo.trackdays");
			d.update("TRUNCATE TABLE trackvoodoo.car");
			d.update("TRUNCATE TABLE trackvoodoo.carpictures");
			d.update("TRUNCATE TABLE trackvoodoo.carmodifications");
			d.update("TRUNCATE TABLE trackvoodoo.usertrackdays");
			
			d.insert("INSERT INTO trackvoodoo.user (name, loginName, password, joinDate, avatar, adminUser) VALUES ('admin', 'admin user', 'staff123', CURDATE(), '', 'True')");
			d.insert("INSERT INTO trackvoodoo.user (name, loginName, password, joinDate, avatar, adminUser) VALUES ('joeh', 'Joe Humphries', 'staff123', CURDATE(), '', 'True')");
			
			d.closeConnection();
		}
	}
}
